package ru.ssau.customerManagement.model.entities;

import java.io.Serializable;

/**
 * Author: illabefat
 * Time: 02.11.2014
 */
public class Customer implements Serializable{
    private static final long serialVersionUID = -3753624543305297128L;

    private Long id;
    private String name;
    private String description;

    public Customer(Long id) {
        this(id, "", "");
    }

    public Customer(Long id, String name, String description) {
        this.id = id;
        this.name = name;
        this.description = description;
    }

    public Long getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Customer)) return false;

        Customer customer = (Customer) o;

        if (!id.equals(customer.id)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return id.hashCode();
    }
}
